<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLiveStreamingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('live_streaming', function (Blueprint $table) {
            $table->increments('id');
            $table->string('direct_broadcasting_title')->default('')->comment('直播间标题');
            $table->string('direct_broadcasting_cover')->default('')->comment('直播间封面图');
            $table->integer('uid')->comment('主播ID');
            $table->dateTime('start_direct_broadcasting')->comment('开播时间');
            $table->dateTime('end_direct_broadcasting')->nullable()->comment('结束时间');
            $table->string('push_url')->nullable()->comment('推流地址:域名+appname');
            $table->string('push_key')->nullable()->comment('推流密钥:streamName+key');
            $table->string('live_url')->default('')->comment('播流地址');
            $table->tinyInteger('direct_broadcasting_state')->default('0')->comment('直播状态,0是关闭直播,1是开启直播');
            $table->integer('attention')->default('0')->comment('关注人数');
            $table->integer('max_number_people')->default('0')->comment('最高在线人数');
            $table->integer('like_number')->nullable()->comment('点赞人数');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('live_streaming');
    }
}
